{% extends "tj3/tj3.html" %}

{% block navigation %}
	<script type="text/javascript">
		$('document').ready(function(){
			$('#advanced_option').hide();
			
			$('#show_advanced_option').click(function(){
				$('#advanced_option').toggle();
			});
			
			$('#create_btn').button();
		});
	</script>
{% endblock navigation %}

{% block content  %} 
<h1 class="ui-widget ui-widget-header">Create a New Resource</h1>
	<div class="ui-widget ui-widget-content mycontent">
	<form action="." method="post" enctype="multipart/form-data">

		<table>
			{{ resource_formset.management_form }}
			{{ resource_formset }}
		</table>
	
	<a href="#" id="show_advanced_option" class="fancy">Advanced options...</a>
	<input id="create_btn" type="submit" name="command" value="Create" class="button float_right" />
	<br />
	<br />
	
	<div id="advanced_option">
	
		<h2 class="ui-state-highlight ui-corner-all">Create a New Work Limit (Optional)</h2>
			<br />
			<div class="fancy">
			<span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
			If creating a new work limit together with creating a new resource, this work limit will be
			linked to this resource automatically.
			</div>
			
			<table>
				{{ worklimit_formset.management_form }}
				{{ worklimit_formset }}
			</table>
	</div>
		
	</form>
	</div>
{% endblock content %}
